indirect function with data validation